/* eslint-disable */
// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import i18n from './locales'
import { VueAxios } from './utils/request'
import themePluginConfig from '../config/themePluginConfig'
import { setupGlobDirectives } from '/@/directives'
import { registerGlobComp } from './vbenComponents/registerGlobComp'
import initAppConfigStore from './logics/initAppConfig'

// import { isDevMode } from './utils/env'
import { setupStore } from './store/pinia'

// Register icon sprite
import 'virtual:svg-icons-register'

// windi样式
import 'virtual:windi-base.css'
import 'virtual:windi-components.css'
import 'virtual:windi-utilities.css'
// 全局样式
import '/@/design/index.less'

// TODO 这两个是需要优化的
// import './router/permission' // 路由守卫
import './router/guard'
import('ant-design-vue/es/style')

// if (isDevMode()) {
// import('ant-design-vue/es/style')
// }

Vue.config.productionTip = false

// 注册axios
Vue.use(VueAxios)

// Configure store
// 配置 store

setupStore(Vue)
// 注册全局组件
registerGlobComp(Vue)

// 注册指令
setupGlobDirectives(Vue)

window.umi_plugin_ant_themeVar = themePluginConfig.theme

new Vue({
  router,
  store,
  i18n,
  created: initAppConfigStore,
  render: (h) => h(App),
}).$mount('#app')
